<ion-view view-title="领单">
  <ion-content class="padding">
    <div>
      <div class="item button-bar" >
        <a class="button button-assertive" ng-click="barscan()">扫码领单</a>
      </div>
    </div>
    <div>
      <div class="item button-bar" >
        <input class="" type="tel" style="width: 75%;" ng-model="orderid" placeholder="输入至少6位连续订单号">
        <a class="button button-positive" ng-click="getOrdersArray(orderid)"><i class="icon ion-ios-search-strong"></i></a>
      </div>
    </div>
    <div class="list card" ng-repeat="order in ordersArray" href="#">
      <div class="item">
        <h2>A1区-

          <span ng-if="(order.type != 9)" style="color: red;">{{order.type | orderTypeName}}</span>
          <span ng-if="(order.get('type') === 9)">商家外卖</span>
            <span ng-bind-html="order.orderid | colorString">
            </span>
        </h2>
      </div>
      <div class="item item-body">
        <p>
          <i class="icon ion-ios-home" style="font-size: x-large;color: orange;"></i>
          {{order.toStreet}}
        </p>
        <p>
          <i class="icon ion-ios-people" style="font-size: x-large;color: orange;"></i>
          {{order.toName}}
          <a href="tel:{{order.toPhone}}">{{order.toPhone}}</a>
          <a href="tel:{{order.toPhone}}" class="icon ion-ios-telephone"></a>
        </p>
        <p >
          <i class="icon ion-arrow-graph-up-right" style="font-size: x-large;color: orange;"></i>
          {{order.status |  orderState }}
        </p>
      </div>
      <div class="row ">
        <div class="col">
          <button class="button button-assertive button-small button-block" ng-click="acceptOrder($index)">
            <b>领取订单</b>
          </button>
        </div>
      </div>
    </div>
    <!--<div  class="list card" ng-repeat="order in ordersArray" href="#">-->
        <!--<div>-->
            <!--<span>{{order.orderid}}</span>-->
            <!--<span>待领单</span>-->
            <!--<span>{{order.area }}区</span>-->
            <!--<span ng-if="(order.type=== 9)">-->
                        <!--商家名称：{{order.sellerName}}&#45;&#45;{{order.get('storeName')}}-->
            <!--</span>-->
            <!--<span>{{order.toStreet}}</span>-->
            <!--<span>{{order.toName}}</span>-->
            <!--<span>{{order.remark}}</span>-->
            <!--<span><button class="button button-assertive " ng-click="acceptOrder($index)"> 领单</button></span>-->
        <!--</div>-->
    <!--</div>-->
    <div ng-if="(ordersArray.length === 0)" class="card">
      <div class="item item-text-wrap">
        啥都没有~
      </div>
    </div>
  </ion-content>
</ion-view>
